#include "stdafx.h"
#include "FindAllArchiElementInPath.h"

FindAllArchiElementInPath::FindAllArchiElementInPath()
{
}

FindAllArchiElementInPath::~FindAllArchiElementInPath()
{
}

bool FindAllArchiElementInPath::IsFileValid(CString fileFullName)
{
	CStringArray csReadLines;
	PublicFunc::ReadSourceFile(fileFullName, csReadLines);
	for (int i = 0; i < csReadLines.GetSize(); i++)
	{
		CString cs = csReadLines[i];
		if (m_bArchiSection)
		{
			if (PublicFunc::IsStrHasStr(cs, _T("public ArchiElementSection")))
			{
				return true;
			}
		}
		else
		{
			if (PublicFunc::IsStrHasStr(cs, _T("public ArchiElementSection")))
			{
				return false;
			}

			if (PublicFunc::IsStrHasStr(cs, _T("public ArchiElement")))
			{
				return true;
			}
		}
	}

	return false;
}
